const baseUrl = "https://shop-api.ksbmtb.com:8886"
 // const baseUrl = "http://192.168.1.51:8082"
 
  // const baseUrl = "https://rhl.mynatapp.cc"
// let ajaxTimes = 0
export const request = (params) => {
	// ajaxTimes++;
	// uni.showLoading({
	// 	title: '加载中',
	// 	mask: true,
	// })
	
	
	params.method = params.method && params.method.toUpperCase();
	return new Promise((resolve, reject) => {
		uni.request({
			...params,
			header: {
				'content-type': 'application/x-www-form-urlencoded'
			},	
			url: baseUrl + params.url,
			success: (result) => {
				resolve(result.data)
			},
			fail: (err) => {
				reject(err)
			},
			complete: () => {
				// ajaxTimes--;
				// if (ajaxTimes === 0) {
				// 	uni.hideLoading()
				// }
			}
		});
	})
}
export function getBaseUrl() {
	return baseUrl
}


